<template>
  <FormItemWrapper v-bind="$attrs" :widget="widget" :designer="designer">
    <Rate
      v-model:value="widgetProps.value"
      :character="widgetProps.character"
      :allowHalf="widgetProps.allowHalf"
      :count="widgetProps.showCount"
      :disabled="widgetProps.disabled"
      :allowClear="widgetProps.allowClear"
      :style="widgetProps.rate_style"
    >
      {{ widgetProps.formItemLabel }}
    </Rate>
  </FormItemWrapper>
</template>
<script lang="ts" name="rate-widget" setup>
  import { ref, computed } from "vue"
  import { Rate } from "ant-design-vue"
  import { useAttrs } from "/@/hooks/core/useAttrs"
  import FormItemWrapper from "./FormItemWrapper.vue"
  import { useWidget } from "../useWidget"
  import type { Designer } from "../../type"
  const props = defineProps({
    widget: { type: Object, default: {} },
    designer: { type: Object as () => Designer },
  })
  const widgetProps = props.widget.props
  const { watchDefaultValue } = useWidget()
  watchDefaultValue(props)
  const attrs = useAttrs()
</script>

<style lang="less"></style>
